<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>12.props_functional_component</title>
</head>
<body>
<div id="app"></div>

<script src="lib/react.development.js"></script>
<script src="lib/react-dom.development.js"></script>
<script src="lib/babel.min.js"></script>
<script src="lib/prop-types.js"></script>

<script type="text/babel">
   function User(props) {
       const {username,age,gender} = props;
       return(
           <ul>
               <li>{username}</li>
               <li>{age}</li>
               <li>{gender}</li>
           </ul>
       )
   }

   Person.defaultProps ={
       username: 'xxxx'
   }

   Person.propTypes ={
       username: PropTypes.string,
       age:PropTypes.number,
       gender:PropTypes.string
   }
   const  user1 ={
       username: "Lucy",
       age:29,
       gender: "Girl"
   }
   ReactDOM.render(<User {...user1}/>,document.getElementById("app"));
</script>
</body>
</html>